<template>
    <div class="user-info" >
        <div v-for="(i,k) in list" :key="k">
            <div class="body type1" v-if="type===1">
                <div class="header clearfix">
                    <div class="avater">
                        <img :src="i.Img" alt="">
                    </div>
                    <p class="user-name">{{i.name}}</p>
                    <img src="../../../assets/commodity/ren.png" alt="">
                </div>
                <div class="details clearfix">
                    <p class="clearfix"><span>擅长：</span><span>{{i.shanchang}}</span></p>
                    <p class="clearfix"><span>简介：</span><span>{{i.jianjie}}</span></p>
                </div>
                <div class="connect-info clearfix">
                    <p style="overflow: hidden" class="clearfix"><span>地址：</span><span>{{i.dizhi}}</span></p>
                    <p><span>电话：</span><span>{{i.dianhua}}</span> </p>
                </div>
            </div>
            <div class="body type2" v-if="type===2">
                <div class="header clearfix">
                    <div class="avater">
                        <img :src="i.Img" alt="">
                    </div>
                    <p class="user-name">{{i.name}}</p>
                    <span>医生</span>
                    <img src="../../../assets/commodity/ren.png" alt="">
                </div>
                <div class="details">
                    <p class="clearfix"><span>擅长：</span><span>{{i.shanchang}}</span></p>
                </div>
                <div class="connect-num clearfix">
                    <ul>
                        <li>
                            <p>123</p>
                            <p>预约</p>
                        </li>
                        <li>
                            <p>123</p>
                            <p>案例</p>
                        </li>
                        <li>
                            <p>123</p>
                            <p>咨询排行</p>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="option" >
                <span class="option-btn half">咨询医院</span>
                <span class="option-btn half">加关注</span>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: "UserInfo",
        props:['list','type']
    }
</script>

<style scoped lang="less">
    @import "../../../style/style.less";
    .user-info{

        .header {
            margin-bottom: 20px;
            >img{
                margin-top: 10px;
            }
            .avater {
                width: 50px;
                height: 50px;
                float: left;
                overflow: hidden;
                border-radius: 50%;
                img {
                    width: 100%;
                    height: 100%;
                }
            }
            .user-name {
                float: left;
                height: 44px;
                line-height: 44px;
                color: #333;
                font-size: 14px;
                font-weight: bold;
                margin-left: 10px;
                overflow: hidden;
                text-overflow:ellipsis;
                white-space: nowrap;
            }
        }
        .details{
          p{
              padding-bottom: 10px;
          }
        }
        .details, .connect-info {
            margin-bottom: 10px;
            p {
                font-size: 14px;
                color: #333;
                >span{
                    display: block;
                    width: 20%;
                    float: left;
                }
                >:last-child{
                    width: 80%;
                }
            }

        }
        .option {
            .option-btn {
                display: inline-block;
                width: 100%;
                text-align: center;
                height: 32px;
                line-height: 32px;
                font-size: 16px;
                border-radius: 4px;
                background-color: @theme-color-dark;
                border-bottom: 2px solid #f4162d;
                color: #fff;
                cursor: pointer;
            }
            .half {
                width: 47%;
                &:first-child {
                    margin-right: 10px;
                }
            }
        }
        .type1{
            .user-name{
                width: 104px;
            }
        }
        .type2{
            .header{
                span{
                    color: #999999;
                    font-size: 14px;
                    padding: 10px 20px 0 15px;
                    margin-top: 10px;
                }
            }
            .user-name{
                line-height: 49px;
            }
            .connect-num{
                margin-bottom: 20px;
                ul{
                    li{
                        float: left;
                        width: 33%;
                        text-align: center;
                        color: #666666;
                        font-size: 12px;
                        >:first-child{
                            color: #fc5370;
                            font-weight: bold;
                        }
                    }
                }
            }
        }
    }


</style>